function [action,alg]=action_selector_boltz(alg)

global EXP_RATE

i1=alg.prodcount+1;


sum=exp(alg.Pi(i1,1))+exp(alg.Pi(i1,2));

if exp(alg.Pi(i1,1))/sum >= exp(alg.Pi(i1,2))/sum
    action=1;
else
    action=2;
end

if alg.Pi(i1,1)>alg.Pi(i1,2)
greedy_action=1;
else
    greedy_action=2;
end



number=rand(1);

if action==greedy_action
    alg.flag=2;
else 
    
    alg.flag=1;
end


